<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <link rel="stylesheet" href="js/bootstrap/css/bootstrap.min.css">
</head>
<body>
    <div class="container">
        <ol class="breadcrumb">
            <li><a href="#">学生成绩管理系统</a></li>
            <li><a href="QueryScoreStudent.html">成绩管理</a></li>
            <li>成绩修改申请</li>
        </ol>
        <h3 class="page-header">申请列表</h3>

        <form class="form-horizontal">
            <div class="form-group">
                <label class="col-sm-2">学生学号:</label>
                <div class="col-sm-8">
                    <input type="text" placeholder="请输入学生学号" class="form-control" v-model="feedback.feedbackSno">
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-2">课程名：</label>
                <div class="col-sm-8">
                    <select class="form-control" v-model="feedback.feedbackCname">
                        <option v-for="(course,index) in datalist">{{course.cname}}</option>
                    </select>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-2">更后成绩：</label>
                <div class="col-sm-8">
                    <input type="text" placeholder="请输入更改后的成绩" class="form-control" v-model="feedback.feedbackScore">
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-2">修改原因：</label>
                <div class="col-sm-8">
                    <textarea placeholder="例如：打分错误等;" class="form-control" v-model="feedback.feedbackRs">
                    </textarea>
                </div>
            </div>
            <div class="form-group">
                <input type="button" value="提交申请" class="btn btn-success" @click="Feedback()">
            </div>
        </form>
    </div>

    <script src="js/vue/vue2.5.js"></script>
    <script src="js/vue/axios.min.js"></script>
    <script src="js/jquery.js"></script>
    <script src="js/layer/layer.js"></script>
    <script>
        new Vue({
            el:'.container',
            data:{
                //存放课程名
                datalist:[],
                feedback:{
                    feedbackSno:'',
                    feedbackCname:'',
                    feedbackScore:'',
                    feedbackRs:''
                }
            },
            methods:{
                queryCname() {
                    axios.get('/course/query')
                        .then(resp =>{
                            this.datalist = resp.data;
                        })
                },
                Feedback() {
                    console.log(this.feedback);
                    axios.get('/feedback/add',{params:this.feedback})
                        .then(resp =>{
                            layer.msg('申请已提交！');
                        })
                }
            },

            mounted(){
                this.queryCname();
            }
        })
    </script>
</body>
</html>